package homework2.common;

import java.io.Serializable;

/**
 * 消息类，用于统一表示客户与服务端之间的消息
 *
 * @author jian
 * @date 2024/01/09 00:03
 **/
public class Message implements Serializable {
    private String sender;//发送者
    private String getter;//接收者
    private String content;//消息内容

    private byte[] fileBytes;//文件类型时，存放位置
    private String commandType;//命令类型 all，target，userlist
    private String contentType;//xml、json、string

    public String getContentType() {
        return contentType;
    }

    public void setContentType(String contentType) {
        this.contentType = contentType;
    }

    public byte[] getFileBytes() {
        return fileBytes;
    }

    public void setFileBytes(byte[] fileBytes) {
        this.fileBytes = fileBytes;
    }

    private String userId;

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getSender() {
        return sender;
    }

    public void setSender(String sender) {
        this.sender = sender;
    }

    public String getGetter() {
        return getter;
    }

    public void setGetter(String getter) {
        this.getter = getter;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getCommandType() {
        return commandType;
    }

    public void setCommandType(String commandType) {
        this.commandType = commandType;
    }

    @Override
    public String toString() {
        return "Message{" +
                "sender='" + sender + '\'' +
                ", getter='" + getter + '\'' +
                ", content='" + content + '\'' +
                ", commandType='" + commandType + '\'' +
                ", contentType='" + contentType + '\'' +
                ", userId='" + userId + '\'' +
                '}';
    }

}
